<template>
  <div>

    <div v-for="(item,index) in pinions" style="margin-top: 10px">

      <div
        style="font-weight: bold;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp:1;overflow: hidden;white-space:pre-wrap;">
        {{index+1}}、
        <span v-if="item.ispositive === 1">[正面]</span>
        <span v-if="item.isneutral === 1">[中性]</span>
        <span v-if="item.isnegative === 1">[负面]</span>
        <span v-html="item.title"></span></div>
      <div style="margin-top: 5px">{{item.publishTime}}</div>
      <div style="margin-top: 5px" v-html="item.content"></div>
      <div style="margin-top: 5px">原文链接：
        <el-link :href="item.url" target="_blank"> {{item.url}}</el-link>
      </div>
    </div>
    <el-skeleton :rows="6" animated v-if="loading"/>

  </div>
</template>
<script>
  import {queryByEventParameter,} from "@/api/system/event";

  export default {
    props: {
      eventId: {
        type: Number,
        default: 0
      },
    },
    data() {
      return {
        loading: true,
        pinions: [],
        queryParams: {},
        pageParams: {
          pageNum: 1,
          pageSize: 10,
        },
      }
    },
    computed: {},
    watch: {},
    mounted() {

    },
    created() {
      this.getList()
    },
    methods: {
      /** 查询舆情清单列表 */
      getList() {
        this.loading = true;
        this.queryParams.eventId = this.eventId
        queryByEventParameter(this.queryParams, this.pageParams).then(response => {
          this.pinions = response.rows;
          this.loading = false;
        });
      },
    }
  }
</script>
